package com.zhuoyue.elmt.service;

import com.eit.eitsite.common.persistence.Page;
import com.eit.eitsite.common.service.CrudService;
import com.zhuoyue.elmt.dao.CsDtcsDao;
import com.zhuoyue.elmt.entity.CsDtcs;
import com.zhuoyue.elmt.entity.DeviceParameters;
import com.zhuoyue.elmt.entity.GgSbjc;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * Created by admin on 2016/12/18.
 */
@Service
@Transactional(readOnly = true)
public class CsDtcsService extends CrudService<CsDtcsDao, CsDtcs> {

    public CsDtcs get(String id) {
        return super.get(id);
    }

    public List<CsDtcs> findList(CsDtcs csDtcs) {
        return super.findList(csDtcs);
    }

    public Page<CsDtcs> findPage(Page<CsDtcs> page, CsDtcs csDtcs) {
        return super.findPage(page, csDtcs);
    }

    @Transactional(readOnly = false)
    public void save(CsDtcs csDtcs) {
        super.save(csDtcs);
    }

    @Transactional(readOnly = false)
    public void delete(CsDtcs csDtcs) {
        super.delete(csDtcs);
    }

    @Transactional(readOnly = false)
    public void update(CsDtcs csDtcs){
        super.update(csDtcs);
    }

    @Transactional(readOnly = false)
    public int modifyCsDtcsParameter(DeviceParameters deviceParameters){
        deviceParameters.preUpdate();
        return dao.modifyCsDtcsParameter(deviceParameters);
    }

    @Transactional(readOnly = false)
    public int newElevatorParameters(DeviceParameters deviceParameters){
        deviceParameters.preInsert();
        return dao.newElevatorParameters(deviceParameters);
    }

    @Transactional(readOnly = false)
    public int deleteCsDtcs(String tzsbbh){
        return dao.deleteCsDtcs(tzsbbh);
    }
}
